import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/sysRole',
    method: 'get',
    params,
  })
}

export function doAdd(data) {
  return request({
    url: '/sysRole',
    method: 'post',
    data,
  })
}

export function doEdit(data) {
  return request({
    url: '/sysRole',
    method: 'put',
    data,
  })
}

export function doDelete(id) {
  return request({
    url: '/sysRole/' + id,
    method: 'delete',
  })
}

export function getUserRolePage(params) {
  return request({
    url: '/sysRole/userRolePage',
    method: 'get',
    params,
  })
}

export function getUserRole(id) {
  return request({
    url: '/sysRole/userRole/' + id,
    method: 'get',
  })
}

export function doAddUserRole(data) {
  return request({
    url: '/sysUserRole',
    method: 'post',
    data,
  })
}

export function doAddUserRoles(data) {
  return request({
    url: '/sysUserRole/roles',
    method: 'post',
    data,
  })
}

export function doDeleteUserRole(id) {
  return request({
    url: '/sysUserRole/' + id,
    method: 'delete',
  })
}

export function doEditDeptMenu(data) {
  return request({
    url: '/sysRole/menuDept',
    method: 'put',
    data,
  })
}

export function getUserRoleList(params) {
  return request({
    url: '/sysRole/userRole',
    method: 'get',
    params,
  })
}
